package com.example.controller;

import com.example.domain.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
public class HelloController {
    @GetMapping("/hello/{username}")
    public String hello(@PathVariable("username") String username) {
        log.info("hello, " + username);
        return "hello, " + username;
    }

    @PostMapping("/user/add")
    public String save(@RequestBody User user) {
        log.info("user info: {}", user);
        return user.getName();
    }
}
